import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [

   {
    title: '订单单号',
    align:"center",
    dataIndex: 'code',
    // ifShow:false,
   },
  {
    title: '下单时间',
    align:"center",
    dataIndex: 'createTime',
    // ifShow:false,
  },
  {
    title: '状态',
    align:"center",
    dataIndex: 'status_dictText'
  },
  {
    title: '商品名',
    align:"center",
    dataIndex: 'commodityName',
  },
  {
    title: '规格',
    align:"center",
    dataIndex: 'specificationItemNames',
  },
  {
    title: '数量',
    align:"center",
    dataIndex: 'num',
  },
  {
    title: '单价',
    align:"center",
    dataIndex: 'price',
  },
  {
    title: '实际支付',
    align:"center",
    dataIndex: 'amount'
  },
  {
    title: '学生姓名',
    align:"center",
    dataIndex: 'personId_dictText'
  },
  {
    title: '学号',
    align:"center",
    dataIndex: 'personCode'
  },

  {
    title: '班级',
    align:"center",
    dataIndex: 'departName'
  },
   {
    title: '地址',
    align:"center",
    dataIndex: 'address'
   },

];
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: '商品名',
    field: 'commodityName',
    component: 'Input',
  },
  {
    label: '买家',
    field: 'personName',
    component: 'Input',
  },
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '人员id',
    field: 'personId',
    component: 'Input',
  },
  {
    label: '商品id',
    field: 'commoditySpecificationId',
    component: 'Input',
  },
  {
    label: '地址',
    field: 'address',
    component: 'Input',
  },
  {
    label: '状态',
    field: 'status',
    component: 'InputNumber',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  personId: {title: '人员id',order: 0,view: 'text', type: 'string',},
  commoditySpecificationId: {title: '商品id',order: 1,view: 'text', type: 'string',},
  address: {title: '地址',order: 2,view: 'text', type: 'string',},
  status: {title: '状态',order: 3,view: 'number', type: 'number',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}
